package com.studyv3.test.controller;

import com.studyv3.common.core.domain.R;
import com.studyv3.test.service.ResourceService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@RequestMapping("/resource/")
public class ResourceController {
    @Resource
    private ResourceService service;
    @Operation(summary = "图片上传")
    @PostMapping("uploadimg")
    public R uploadImg(@RequestPart MultipartFile file) throws IOException {
        System.err.println("图片上传");
        return service.uploadImg(file);
    }
}
